home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Sound / MPEGAlib / developer / include / clib / mpega_protos.h
C/C++ Source or Header  |  1997-11-02  |  3KB  |  87 lines

  1. /*------------------------------------------------------------------------------
  2.  
  3.     File    :   MPEGA_protos.h
  4.  
  5.     Author  :   Stéphane TAVENARD
  6.  
  7.     $VER:   MPEGA_protos.h  1.0  (25/10/1997)
  8.  
  9.     (C) Copyright 1997-1997 Stéphane TAVENARD
  10.         All Rights Reserved
  11.  
  12.     #Rev|   Date   |                      Comment
  13.     ----|----------|--------------------------------------------------------
  14.     0   |25/10/1997| Initial revision                                     ST
  15.  
  16.     ------------------------------------------------------------------------
  17.  
  18.     MPEGA decoder library functions prototypes
  19.  
  20. ------------------------------------------------------------------------------*/
  21.  
  22. #ifndef CLIB_MPEGA_PROTOS_H
  23. #define CLIB_MPEGA_PROTOS_H
  24.  
  25. #ifndef LIBRARIES_MPEGA_H
  26. #include <libraries/mpega.h>
  27. #endif
  28.  
  29. MPEGA_STREAM *MPEGA_open( char *stream_name, MPEGA_CTRL *ctrl );
  30. /*--------------------------------------------------------------------------
  31.    Open an MPEG Audio stream
  32.    Inputs: stream_name = name of stream to decode
  33.            ctrl = decoding controls
  34.    Return the mpeg audio stream ptr or NULL if failed to open stream
  35. */
  36.  
  37. void MPEGA_close( MPEGA_STREAM *mpds );
  38. /*--------------------------------------------------------------------------
  39.    Close an MPEG Audio stream
  40.    Input:  mpds =  mpeg audio stream ptr returned by MPEGA_open
  41. */
  42.  
  43. LONG MPEGA_decode_frame( MPEGA_STREAM *mpds, WORD *pcm[ MPEGA_MAX_CHANNELS ] );
  44. /*--------------------------------------------------------------------------
  45.    Decode the current MPEG Audio frame
  46.    Input:  mpds =  mpeg audio stream ptr returned by MPEGA_open
  47.    Output: pcm[] = 16-bit samples
  48.                    pcm[ 0 ] is mono or left voice or channel 1
  49.                    pcm[ 1 ] is right or channel 2
  50.    Return the number of samples or error code:
  51.       MPEGA_ERR_EOF if end of stream
  52.       MPEGA_ERR_BADFRAME if bad frame
  53.  
  54.    Note: pcm[]'s be at least arrays of MPEGA_PCM_SIZE
  55.          number of samples can be 0 if current frame is skipped, in case
  56.          of error in crc or not enough data for decoding (layer III)
  57.          number of samples = 0 does not indicate end of stream !
  58. */
  59.  
  60. LONG MPEGA_seek( MPEGA_STREAM *mpds, ULONG ms_time_position );
  61. /*--------------------------------------------------------------------------
  62.    Seek into an MPEG Audio stream
  63.    Inputs:  mpds = mpeg audio stream ptr returned by MPEGA_open
  64.             ms_time_position = absolute time position in ms
  65.    Return 0 if Ok, MPEGA_ERR_EOF if outside of stream
  66. */
  67.  
  68. LONG MPEGA_time( MPEGA_STREAM *mpds, ULONG *ms_time_position );
  69. /*--------------------------------------------------------------------------
  70.    Get the current time position of an MPEG Audio stream
  71.    Input:  mpds = mpeg audio stream ptr returned by MPEGA_open
  72.    Output: ms_time_position = absolute time position in ms
  73.    Return 0 if Ok
  74. */
  75.  
  76. LONG MPEGA_find_sync( BYTE *buffer, LONG buffer_size );
  77. /*--------------------------------------------------------------------------
  78.    Find an mpeg synchronization pattern in a buffer
  79.    This function can be use to check if a file contains MPEG audio stream
  80.    Inputs: buffer = stream buffer to analyze
  81.            buffer_size = need to know top of buffer (must be >= 4)
  82.    Return the the sync position (>=0) or MPEGA_ERR_NO_SYNC if not found
  83. */
  84.  
  85.  
  86. #endif /* CLIB_MPEGA_PROTOS_H */
  87.